package com.fwtai.api.controller;

import com.fwtai.config.ConfigFile;
import com.fwtai.service.api.ApiAreaService;
import com.fwtai.tool.ToolClient;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;

/**
 * 区域地区
 * @作者 田应平
 * @版本 v1.0
 * @创建时间 2021年7月20日 16:15:12
 * @QQ号码 444141300
 * @Email service@yinlz.com
 * @官网 <url>http://www.fwtai.com</url>
*/
@Api(tags = "区域地区",description = "token选填")
@RestController
@RequestMapping(ConfigFile.guest_v10 + "area")
public class AreaControlle{

    @Resource
    private ApiAreaService apiAreaService;

    @ApiOperation(value = "通过父级id区域获取数据,token不填", notes = "获取区域地区数据")
    @ApiImplicitParams({
        @ApiImplicitParam(name = "pid", value = "父id,默认为0,即获取省或直辖市", dataType = "String", paramType = "query", required = false)
    })
    @GetMapping("/getAreaData")
    public void getAreaData(final String pid,final HttpServletResponse response){
        ToolClient.responseJson(apiAreaService.getAreaData(pid),response);
    }
}